﻿using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Options;

namespace Three_Red_Dragon_Mvc.Controllers
{
    /// <summary>
    /// 工作中心
    /// </summary>
    public class WorkCenterController : Controller
    {
        private readonly IpAddressesConfig _ipAddressesConfig;

        public WorkCenterController(IOptions<IpAddressesConfig> ipAddressesConfig)
        {
            _ipAddressesConfig = ipAddressesConfig.Value;
        }
        /// <summary>
        /// 工作中心列表
        /// </summary>
        /// <returns></returns>
        public IActionResult QueryWorkCenter()
        {
            ViewBag.RBACWrite = _ipAddressesConfig.RBACWrite;
            ViewBag.RedDragonWrite = _ipAddressesConfig.RedDragonWrite;
            return View();
        }

        /// <summary>
        /// 工作中心添加
        /// </summary>
        /// <returns></returns>
        public IActionResult CreateWorkCenter()
        {
            ViewBag.RBACWrite = _ipAddressesConfig.RBACWrite;
            ViewBag.RedDragonWrite = _ipAddressesConfig.RedDragonWrite;
            return View();
        }

        /// <summary>
        /// 资源添加
        /// </summary>
        /// <returns></returns>
        public IActionResult CreateResources()
        {
            ViewBag.RBACWrite = _ipAddressesConfig.RBACWrite;
            ViewBag.RedDragonWrite = _ipAddressesConfig.RedDragonWrite;
            return View();
        }

        /// <summary>
        /// 工作中心修改
        /// </summary>
        /// <returns></returns>
        public IActionResult UpdateWorkCenter()
        {
            ViewBag.RBACWrite = _ipAddressesConfig.RBACWrite;
            ViewBag.RedDragonWrite = _ipAddressesConfig.RedDragonWrite;
            return View();
        }
    }
}
